const Test = () => import('@/views/test')
const Debug = () => import('@/views/debug')
const Home = () => import('@/views/home')

const isDev = process.env.NODE_ENV === 'development'

const routes = [
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/debug',
    name: 'debug',
    component: Debug
  },
  {
    path: '*',
    redirect: {name: 'home'}
  }
]

if (isDev) { // 开发环境引入测试页面
  routes.push({
    path: '/test',
    name: 'test',
    component: Test
  })
}

export default routes
